#%RAML 1.0
title: Permissions Interface
version: v1
baseUri: http://github.com/org/folio/mod-auth/_tenantPermissions

documentation:
  - title: tenant permissions API implementation
    content: This API provides a callback point for Okapi when new permission sets are added to the tenant

types:
  okapiPermission.json: !include ../../schemas/mod-permissions/okapiPermission.json
  okapiPermissionSet: !include ../../schemas/mod-permissions/okapiPermissionSet.json
  errors: !include ../../schemas/errors.schema

traits:
  validate: !include ../../traits/validation.raml

/_/tenantpermissions:
  get:
    description: Dummy get endpoint
    body:
      text/plain:
        example: "Blah"
    responses:
      200:
        body:
          text/plain:
            example: "Blah"
  post:
    description: "Load new permissionSets into the permission module when a module gets enabled for a tenant"
    is: [validate]
    body:
      application/json:
        type: okapiPermissionSet
        example: !include ../../examples/tenantPermissions.sample
    responses:
      201:
        description: "Permissions loaded successfully"
        body:
          application/json:
            type: okapiPermissionSet
      400:
        description: "Bad request"
        body:
          text/plain:
            example: "Bad request"
      500:
        description: "Internal server error"
        body:
          text/plain:
            example: "Error"

